package logobj.utils;

import java.sql.Timestamp;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TimeUtils {
    public static Timestamp getTimestamp(){
        Date dt = new Date();
      return  new Timestamp(dt.getTime());
    }
    public static String getStringNowDate() {
        return getStringNowDate("yyyy-MM-dd HH:mm:ss");
    }
    public static String getStringNowDate(String pattern) {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat(pattern);
        String dateString = formatter.format(currentTime);
        return dateString;
    }
 /*   public static void main( String[] args ){
        String pastr ="yyyy-MM-dd";
        System.out.println(getStringNowDate(pastr));
    }*/
}
